package org.huzhp;

import com.netflix.eureka.resources.StatusResource;
import org.huzhp.core.EurekaStatus;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description: eureke
 * @Author: huzp
 * @CreateDate: 2020/3/16 22:42
 * @Version: 1.0
 */
@RestController
@RequestMapping("myeureka")
public class MyEurekaController {

    @Value("${spring.application.version}")
    private String version;

    @GetMapping("status")
    public EurekaStatus getEurekaStatus() {
        EurekaStatus eurekaStatus = new EurekaStatus(new StatusResource().getStatusInfo());
        eurekaStatus.setVersion(version);
        return eurekaStatus;
    }
}
